In [1]:
using Plots, ApproxFun
In [4]:
S=Legendre()⊕JacobiWeight(0.5,0.,Ultraspherical(1))
Q½=LeftIntegral(S,0.5)
y=(I+Q½)\1
plot(y)
Out[4]:
We can compare with the exact solution:
In [5]:
x=Fun()
norm(exp(1+x)*erfc(sqrt(1+x))-y)
Out[5]:
In [6]:
S=Legendre()⊕JacobiWeight(0.5,0.,Ultraspherical(1))
x=Fun()
Q½=LeftIntegral(S,0.5)
y=(I+exp(-(1+x)/2)*Q½[exp((1+x)/2)])\exp(-(1+x)/2)
plot(y)
Out[6]:
We can compare with the exact solution:
In [7]:
norm(y-exp((1+x)/2)*erfc(sqrt(1+x)))
Out[7]: